package com.ruoyi.deeplearn.service.impl;

import java.util.List;

import cn.hutool.core.util.IdUtil;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.deeplearn.mapper.DeepDatasetImportLogMapper;
import com.ruoyi.deeplearn.domain.DeepDatasetImportLog;
import com.ruoyi.deeplearn.service.IDeepDatasetImportLogService;

/**
 * 导入日志Service业务层处理
 * 
 * @author 任伟伟
 * @date 2022-12-10
 */
@Service
public class DeepDatasetImportLogServiceImpl implements IDeepDatasetImportLogService 
{
    @Autowired
    private DeepDatasetImportLogMapper deepDatasetImportLogMapper;

    /**
     * 查询导入日志
     * 
     * @param id 导入日志主键
     * @return 导入日志
     */
    @Override
    public DeepDatasetImportLog selectDeepDatasetImportLogById(Long id)
    {
        return deepDatasetImportLogMapper.selectDeepDatasetImportLogById(id);
    }

    /**
     * 查询导入日志列表
     * 
     * @param deepDatasetImportLog 导入日志
     * @return 导入日志
     */
    @Override
    public List<DeepDatasetImportLog> selectDeepDatasetImportLogList(DeepDatasetImportLog deepDatasetImportLog)
    {
        return deepDatasetImportLogMapper.selectDeepDatasetImportLogList(deepDatasetImportLog);
    }

    /**
     * 新增导入日志
     * 
     * @param deepDatasetImportLog 导入日志
     * @return 结果
     */
    @Override
    public int insertDeepDatasetImportLog(DeepDatasetImportLog deepDatasetImportLog)
    {
        deepDatasetImportLog.setId(IdUtil.getSnowflakeNextId());
        deepDatasetImportLog.setCreateTime(DateUtils.getNowDate());
        return deepDatasetImportLogMapper.insertDeepDatasetImportLog(deepDatasetImportLog);
    }

    /**
     * 修改导入日志
     * 
     * @param deepDatasetImportLog 导入日志
     * @return 结果
     */
    @Override
    public int updateDeepDatasetImportLog(DeepDatasetImportLog deepDatasetImportLog)
    {
        deepDatasetImportLog.setUpdateTime(DateUtils.getNowDate());
        return deepDatasetImportLogMapper.updateDeepDatasetImportLog(deepDatasetImportLog);
    }

    /**
     * 批量删除导入日志
     * 
     * @param ids 需要删除的导入日志主键
     * @return 结果
     */
    @Override
    public int deleteDeepDatasetImportLogByIds(Long[] ids)
    {
        return deepDatasetImportLogMapper.deleteDeepDatasetImportLogByIds(ids);
    }

    /**
     * 删除导入日志信息
     * 
     * @param id 导入日志主键
     * @return 结果
     */
    @Override
    public int deleteDeepDatasetImportLogById(Long id)
    {
        return deepDatasetImportLogMapper.deleteDeepDatasetImportLogById(id);
    }
}
